package niu.toy.spring.mvc;

import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ClassUtil;


public interface HandlerArgumentResolver {

    boolean supportsParameter(HandlerMethodParameter parameter);


    Object resolveArgument(HandlerMethodParameter parameter, NativeWebRequest request, ModelAndViewContainer mavContainer) throws Exception;

    public static boolean isSimpleProperty(Class<?> clazz) {
        Assert.notNull(clazz, "Class must not be null");
        return ClassUtil.isSimpleValueType(clazz) || (clazz.isArray() && ClassUtil.isSimpleValueType(clazz.getComponentType()));
    }

}
